package jUnitTest;

import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import java.util.regex.Pattern;

import org.junit.Test;

public class TestRegex {

	@Test
	public void test() {
		String reg1 = "[0-5]+";
		String src1 = "6123";
		boolean b1 = src1.matches(reg1);
		System.out.println(b1);
	}

	@Test
	public void test1() {
		String s="abasdsa12456wea12345s";
		Pattern.compile(s);
		String r="\\D+";
		String[] ss = s.split(r);
		for(String str:ss)
		{
			System.out.print(str);
		}
	}
	
	@Test
	public void test3() {
		String url="http://www.sohu.com/new/list.do?uname=john";
		String r = "://|/|\\?";
		String[] sp = url.split(r);
		for(String str:sp)
		{
			System.out.println(str);
		}
	}
	
	@Test
	public void test4() {
		Date date1 = new Date();
		Date date2= new Date(999999999);
		System.out.println(date1);
		System.out.println(date2);
		Calendar calendar=Calendar.getInstance(TimeZone.getTimeZone("Asia/Tokyo"),Locale.JAPANESE);
		System.out.println(calendar.getTime());
	}
	
	@Test
	public void test5() {
		Date date = new Date();
		new java.sql.Date(date.getTime());
		System.out.println(date.getTime());
	}
}
